/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.wlyy.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.yihu.wlyy.entity.doctor.DoctorMedicalRecordsPartItem;

public interface DoctorMedicalRecordsPartItemDao extends PagingAndSortingRepository<DoctorMedicalRecordsPartItem, Long>, JpaSpecificationExecutor<DoctorMedicalRecordsPartItem> {
	// 查询医生的片段输入项
	@Query("select a from DoctorMedicalRecordsPartItem a where (a.doctor = ?1 or a.doctor is null) and a.part = ?2 and a.del = '1'")
	List<DoctorMedicalRecordsPartItem> findByDoctor(String doctor, String part);

	@Query("select a from DoctorMedicalRecordsPartItem a where (a.doctor = ?1 or a.doctor is null) and a.del = '1'")
	List<DoctorMedicalRecordsPartItem> findByDoctor(String doctor);

}
